package com.elite.service;

import com.elite.dao.FileGoodsMapper;
import com.elite.dao.GoodsMapper;
import com.elite.entity.FileGoods;
import com.elite.entity.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by hbl on 2017/2/4.
 */
@Service("GoodsService")
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;
    @Autowired
    private FileGoodsMapper fileGoodsMapper;


    @Override
    public void addGoods(Goods goods) {
        goodsMapper.insert(goods);
    }

    @Override
    public List searchGoodsByGoodsName(String goodsName) {
        return goodsMapper.selectByGoodsName(goodsName);
    }

    @Override
    public List selectGoodsByGoodCategory(String goodCategory) {
        return goodsMapper.selectByGoodCategory(goodCategory);
    }

    @Override
    public List selectGoodsBySellterId(Integer sellerId) {
        return goodsMapper.selectBySellerId(sellerId);
    }

    @Override
    public List selectByGoodsId(Integer goodsId) {
        return fileGoodsMapper.selectByGoodsId(goodsId);
    }

    @Override
    public void changeGoods(Goods goods) {

    }

    @Override
    public void deleteByGoodsId(Integer goodsId) {

    }

    @Override
    public void updateByPrimaryKey(Goods goods) {
        goodsMapper.updateByPrimaryKey(goods);
    }

    @Override
    public List selectGoods() {
        return goodsMapper.selectGoods();
    }

    @Override
    public Goods selectByPrimaryKey(Integer goodsId) {
        return goodsMapper.selectByPrimaryKey(goodsId);
    }


}
